package br.com.widgets.listview;

import java.util.ArrayList;
import java.util.List;
import br.com.widgets.models.Paises;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class MyListDois extends ListActivity {
	
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);		
		ArrayAdapter<Paises> myAdapter = new MyAdapter(this, getListaDePaises());
		setListAdapter(myAdapter);
	}
	
	private List<Paises> getListaDePaises(){		
		String [] lstPaises = getResources().getStringArray(R.array.Paises);		
		List<Paises> listaDePaises = new ArrayList<Paises>();		
		for(String item : lstPaises) listaDePaises.add(getPais(item));		
		return listaDePaises;	
	}
	
	private Paises getPais(String pais){		
		return new Paises(pais);		
	}
	
	
	
	
	

}
